package com.ybwh.springboot2.mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * <p>
 *     不建议mapstruct用spring模式
 * </p>
 *
 * @author fanbeibei
 * @version V1.0
 * @since 2020/5/7 15:04
 */
@Mapper(unmappedSourcePolicy = ReportingPolicy.WARN,unmappedTargetPolicy = ReportingPolicy.WARN)
public interface UserInfoMap {

    /**
     * 用来调用实例 实际开发中可使用注入Spring  不写
     */
    UserInfoMap INSTANCE = Mappers.getMapper(UserInfoMap.class);

    /**
     * 源类型 目标类型 成员变量相同类型 相同变量名 不用写{@link Mapping}来映射
     *
     * @param userInfo
     * @return
     */
//    @Mapping(target = "wxAlias", source = "wx_alias")
//    @Mapping(target = "remarkName", source = "remark_name")
//    @Mapping(target = "headImg", source = "head_img")
//    WxUserInfo toWxUserInfo(UserInfo userInfo);
}
